<?php (!defined('IN_SYSTEM') || !defined('ADMIN_PRE')) && exit('Access Denied!');?>
{admintemplate header}
<div class="box">
	<div class="heading">
	<h1>{l('Advertisment','adv')}</h1>
	<div class="buttons">
	<a href="{url admin.php?m=adv&f=index}" class="fr current">{l('All Advertisment','adv')}</a>
	<a href="{url admin.php?m=adv&f=add}" class="fr">{l('Add','adv')}</a>
	</div>
	</div>
	<div class="main">
	
	<div class="search">
			<form name="search" method="GET" action="{url admin.php?m=adv}">
				<fieldset>
					<legend>{l('Search','adv')}</legend>
						{l('Title','adv')}：<input type="text" name="pname" size="35" value="{urldecode($pname)}" />
						 {l('Status','adv')}：<select name="pstatus">
						<option  value="9">{l('All','adv')}</option>
						{loop $status $k $v}
						<option {if $pstatus==$k}selected="selected"{/if} value="{$k}">{$v}</option>{/loop}</select>
						<input type="submit" name="s" class="button" value="{l('Search','adv')}" />
				</fieldset>
			</form>
	</div>
	
	<form name="update" method="post" action="{url admin.php?m=adv}">
			<table class="list" id="list" cellspacing="0">
				<thead>
				<tr>{if ican("advdelete")}
					<td width="1">
 					<input type="checkbox" class="checkbox" value="1" name="chkall" onclick="check_all(this)" />
					</td>
					{/if}
					<td>{l('Title','adv')}</td>
					<td>{l('Available','adv')}</td>
					<td>{l('Display Order','adv')}</td>
					<td>{l('Show Style','adv')}</td>
					<td>{l('Start Time','adv')}</td>
					<td>{l('End Time','adv')}</td>
					<td>{l('Market Scope','adv')}</td>
					<td>{l('Operation','adv')}</td>
				</tr>
				</thead>
				<tbody>
				{loop $datas $row}
				<tr id="row_{$row['id']}">
				{if ican("advdelete")}
					<td align="center"  width="1"><input type="checkbox" name="id[]" value="{$row['id']}" class="checkbox" /></td>
				{/if}	
					<td>{$row['title']}</td>
					<td><input type="checkbox" {if $row['inuse']}checked=""{/if} value="1" name="inuse[{$row['id']}]" class="checkbox"></td>
					<td><input type="text" value="{$row['displayorder']}" name="displayorder[{$row['id']}]" size="2" ></td>
					<td>{$row['content']['type']}</td>
					<td>{if $row['starttime']>0}{gdate('Y-m-d', $row['starttime'])}{/if}</td>
					<td>{if $row['endtime']>0}{gdate('Y-m-d', $row['endtime'])}{/if}</td>
					<td>{$status[$row['targets']]}</td>
					<td>
					{if ican("advedit")}
					<a href="{url admin.php?m=adv&f=add&id=$row[id]}" target="_blank">{l('Edit','adv')}</a>
					{/if}
					{if ican("advdelete")}
					 | <a href="{url admin.php?m=adv&f=delete&id=$row[id]}" target="_blank" onclick="return confirm('{l('Sure Delete?','adv')}')">{l('Delete','adv')}</a>
					{/if}
					</td>
				</tr>
				{/loop}
				<tr>
					<td><input type="checkbox" class="checkbox" value="1" name="chkall" onclick="check_all(this)" /></td>
					<td colspan="10"  class="left">
					{if ican("advedit")}
					<input type="radio" name="f" id="edit" value="edit" class="radio" /><label for="delete">{l('Update','adv')}</label>
					{/if}
					{if ican("advdelete")}
					<input type="radio" name="f" id="delete" value="delete" class="radio" /><label for="delete">{l('Delete','adv')}</label>
					{/if}
					<input type="submit" class="button"  value="{l('Submit','adv')}"/>
					{$page}
					</td>
				</tr>
				</tbody>
			</table>
	</form>
		
	</div>
</div>
{admintemplate footer}